<%@ page language="java"
    import="java.util.ArrayList,
             java.util.Iterator,
             com.scalar.chiptrack.operations.process.StepProperty,
             com.scalar.chiptrack.operations.process.ProcessTrack,
             com.scalar.chiptrack.utils.ConfigManager,
			 org.apache.struts.util.MessageResources,
			 com.scalar.chiptrack.commons.Labels,
             com.scalar.chiptrack.commons.Constants"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
%>
<!--chiptrack:checkLogon sourcePage="/jsp/operations/process_view.jsp"/-->
<chiptrack:checkLogon sourcePage="/baseProductList.do"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href='<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css' type='text/css' rel='stylesheet'>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight='0' marginwidth='0'>
<!-- Top Header Start-->
<%@include file="/jsp/includes/header.jsp"  %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

    <!-- Side Navigation start -->
    <%@include file="/jsp/operations/product_menu.jsp" %>
    </TD>
    <!-- end of the side navigations -->

    <TD bgcolor="#ffffff">
    <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
    <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
    <TD valign="middle" width="95%" align="center">

    <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
    <BR>
    <!-- from here your body starts -->
		<table>
				<%     
					String baseProductId = (String)request.getParameter("baseProductID");
					String baseProductName = (String)request.getParameter("baseProductName");
					//String servletUrlPath =  "http://"+ request.getServerName()+":"+ request.getServerPort()+request.getContextPath();
                    String servletUrlPath = request.getScheme() + "://"+ request.getServerName()+":"+ request.getServerPort()+request.getContextPath();
					if( baseProductName == null )
					{
						baseProductId = (String)request.getAttribute("baseProductID");
						baseProductName = (String)request.getAttribute("baseProductName");
					}

				%>
			<tr>
				<td align="center" class="NArialW">
					<%= baseProductName %> Product Setup

				</td>
			</tr>
			<tr>
				<td>

				<%
					String mktgPartTitle = "";
					try
					{
						mktgPartTitle = MessageResources.getMessageResources(Labels.APPLICATION_RESOURCE_PROPERTIES).getMessage("label.mktgPartNumber");
					}
					catch( NullPointerException e )
					{
						mktgPartTitle = Labels.DEFAULT_MKTG_PART_NUMBER_LABEL;
					}
                    String isDupMktgPartNumberAllowed = Boolean.toString( ConfigManager.isDupMktgPartNumberAllowed() );
                %>
                <%
                    String integrationType = "";
                    try{
                        if( Constants.FINANCE_INTEGRATION_TYPE_GREAT_PLAINS.equals( ConfigManager.getFinanceIntegrationType() ) )
                        {
                            integrationType = Constants.FINANCE_INTEGRATION_TYPE_GREAT_PLAINS;
                        }else{
                            integrationType = Constants.FINANCE_INTEGRATION_TYPE_LOCAL;
                        }
                    }
                    catch( NullPointerException ae )
                    {
                        integrationType = Constants.FINANCE_INTEGRATION_TYPE_LOCAL;
                    }

                %>

<OBJECT classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"
          height="600"
          width="1000"
          codebase="http://java.sun.com/update/1.6.0/jinstall-6u10-windows-i586.cab">
     <PARAM NAME="code" VALUE="com.scalar.chiptrack.workflow.Editor.class">
     <PARAM NAME="codebase" VALUE="<%=chipTracContext%>">
     <PARAM name="type" value="application/x-java-applet;version=1.6">   
	 <PARAM NAME="archive" VALUE="workflow.jar, jgraph.jar">
	 <param name="productName" value="<%=baseProductName%>" >
	 <param name="productId" value="<%=baseProductId%>" >
	 <param name="mktgPartTitle" value="<%=mktgPartTitle%>" >
	 <param name="contextURL" value="<%=servletUrlPath%>" >
     <param name="integrationType" value="<%=integrationType%>" >
     <param name="userModifyPermission" value="<%= user.isActionAllowed( Functionality.PRODUCT_SETUP, User.USER_ACTION_MODIFY ) %>" >
     <param name="isDupMktgPartNumberAllowed" value="<%=isDupMktgPartNumberAllowed%>" >
     <param name="isShowProductSetupFromDB" value="<%=ConfigManager.getBooleanProperty(ConfigManager.SHOW_PRODUCT_SETUP_FROM_DB )%>" >

  </OBJECT>
				</td>
			</tr>
		</table>

    <!-- till here -->

    <BR><BR><BR>
    </TD>
    <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
    </TR>
    </TABLE>

    <!-- Footer starts here -->
    <%@include file="/jsp/includes/footer.jsp" %>
    <!-- footer end here -->

</BODY>
</HTML>